package com.sjd.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class RouterController {
    //跳转首页界面
    @RequestMapping({"/" , "/index"})
    public String toindex(){
        return "index";
    }
    //跳转登录界面
    @RequestMapping("/toLogin")
    public String tologin(){
        return "/views/login";
    }

    @RequestMapping("/level1/{id}")
    public String topage1(@PathVariable("id") int id){

        return "views/level1/"+id;
    }

    @RequestMapping("/level2/{id}")
    public String topage2(@PathVariable("id") int id){

        return "views/level2/"+id;
    }

    @RequestMapping("/level3/{id}")
    public String topage3(@PathVariable("id") int id){

        return "views/level3/"+id;
    }
}
